-- select * from cv_education
-- delete from cv_education
INSERT INTO cv_education
SELECT 
case len(convert(varchar(10),id))
	when 6 then '00000000-0000-0000-0000-000000' + convert(varchar(10),id) 
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),id) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),id) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),id) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),id) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),id) 
    end As Id,Schoolname AS [SchoolName],majorselect AS [Major1],subselect AS [Major2],subjectname AS [OtherMajor],begindate AS [StartDate],enddate AS [EndDate],educational AS [EducationLevel],isStuAbroad AS [IsAbroad],NULL as SchoolTag,OtherInfo AS [Notes],'00000000-0000-0000-0000-00000' + convert(varchar(7),resumeid) AS  [ResumeId],CreatedDate AS [DateCreated],UpdatedDate AS [LastUpdated]FROM srv_lnk.nchr2008.dbo.PersonEducation
where resumeid in (select right(id,7) from cv_resume)
-- SELECT TOP 10 * FROM srv_lnk.nchr2008.dbo.PersonEducation
-- SELECT max(id) FROM srv_lnk.nchr2008.dbo.PersonEducation


